<table cellspacing="1" cellpadding="3" style="background: #fff;width:100%">
<tr>
    <td class="aslefttd" ><label class="tlable">A:<input type="radio" name="answer" value="0" <?php if ($ans){if ($ans['res']=='0'){ echo ' checked="checked"';}}?>></label></td>
    <td><input type="text" class="input4" id="single_a" <?php if ($ans) { echo 'value="'.$ans['answer']['single_a'].'"';}?>></td>			    
</tr>
<tr>
    <td class="aslefttd" ><label class="tlable">B:<input type="radio" name="answer" value="1" <?php if ($ans){if ($ans['res']=='1'){ echo ' checked="checked"';}}?>></label></td>
    <td><input type="text" class="input4" id="single_b" <?php if ($ans) { echo 'value="'.$ans['answer']['single_b'].'"';}?>></td>			    
</tr>
<tr>
    <td class="aslefttd" ><label class="tlable">C:<input type="radio" name="answer" value="2" <?php if ($ans){if ($ans['res']=='2'){ echo ' checked="checked"';}}?>></label></td>
    <td><input type="text" class="input4" id="single_c" <?php if ($ans) { echo 'value="'.$ans['answer']['single_c'].'"';}?>></td>			    
</tr>
<tr>
    <td class="aslefttd" ><label class="tlable">D:<input type="radio" name="answer" value="3" <?php if ($ans){if ($ans['res']=='3'){ echo ' checked="checked"';}}?>></label></td>
    <td><input type="text" class="input4" id="single_d" <?php if ($ans) { echo 'value="'.$ans['answer']['single_d'].'"';}?>></td>			    
</tr>
<tr>
    <td class="aslefttd" ><label class="tlable">E:<input type="radio" name="answer" value="4" <?php if ($ans){if ($ans['res']=='4'){ echo ' checked="checked"';}}?>></label></td>
    <td><input type="text" class="input4" id="single_e" <?php if ($ans) { echo 'value="'.$ans['answer']['single_e'].'"';}?>></td>			    
</tr>
<tr>
    <td class="aslefttd" ><label class="tlable">F:<input type="radio" name="answer" value="5" <?php if ($ans){if ($ans['res']=='5'){ echo ' checked="checked"';}}?>></label></td>
    <td><input type="text" class="input4" id="single_f" <?php if ($ans) { echo 'value="'.$ans['answer']['single_f'].'"'; }?>></td>			    
</tr>
</table><script>
function getAnswer()
{
	var res = getNameVal("answer");
    if(!res){
        return false;
    }
	var single_a=$.trim($("#single_a").val());
	var single_b=$.trim($("#single_b").val());
	var single_c=$.trim($("#single_c").val());
	var single_d=$.trim($("#single_d").val());
	var single_e=$.trim($("#single_e").val());
	var single_f=$.trim($("#single_f").val());
    var tmpobj = {"res":res,"answer":{"single_a":single_a,"single_b":single_b,"single_c":single_c,"single_d":single_d,"single_e":single_e,"single_f":single_f}};
    return $.toJSON(tmpobj);
}
</script>